-
Notifications
You must be signed in to change notification settings - Fork 261
Feature: Load config service #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Crola1702 <[email protected]>
Signed-off-by: Crola1702 <[email protected]>
Signed-off-by: Crola1702 <[email protected]>
| #include <rclcpp/service.hpp> | ||
| #include <rviz_resource_interfaces/srv/load_config.hpp> | ||
|
|
||
| #include "rviz_common/config.hpp" | ||
| #include "rviz_rendering/render_window.hpp" | ||
| #include "rviz_common/window_manager_interface.hpp" | ||
| #include "rviz_common/ros_integration/ros_node_abstraction_iface.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #include <rclcpp/service.hpp> | |
| #include "rviz_common/config.hpp" | |
| #include "rviz_common/window_manager_interface.hpp" | |
| #include "rviz_common/ros_integration/ros_node_abstraction_iface.hpp" | |
| #include "rviz_rendering/render_window.hpp" | |
| #include <rviz_resource_interfaces/srv/load_config.hpp> |
|
|
||
| void | ||
| loadDisplayConfigService( | ||
| const std::shared_ptr<LoadConfig::Request> request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <memory>
| #include <rclcpp/service.hpp> | ||
| #include <rviz_resource_interfaces/srv/load_config.hpp> | ||
|
|
||
| #include "rclcpp/clock.hpp" | ||
| #include "tf2_ros/buffer.hpp" | ||
| #include "tf2_ros/transform_listener.hpp" | ||
|
|
||
| #include "rviz_common/load_resource.hpp" | ||
| #include "rviz_common/logging.hpp" | ||
| #include "rviz_common/panel.hpp" | ||
| #include "rviz_common/panel_dock_widget.hpp" | ||
| #include "rviz_common/render_panel.hpp" | ||
| #include "rviz_common/tool.hpp" | ||
| #include "rviz_common/yaml_config_reader.hpp" | ||
| #include "rviz_common/yaml_config_writer.hpp" | ||
| #include "rviz_rendering/render_window.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #include "rclcpp/clock.hpp" | |
| #include <rclcpp/service.hpp> | |
| #include "tf2_ros/buffer.hpp" | |
| #include "tf2_ros/transform_listener.hpp" | |
| #include "rviz_common/load_resource.hpp" | |
| #include "rviz_common/logging.hpp" | |
| #include "rviz_common/panel.hpp" | |
| #include "rviz_common/panel_dock_widget.hpp" | |
| #include "rviz_common/render_panel.hpp" | |
| #include "rviz_common/tool.hpp" | |
| #include "rviz_common/yaml_config_reader.hpp" | |
| #include "rviz_common/yaml_config_writer.hpp" | |
| #include "rviz_rendering/render_window.hpp" | |
| #include <rviz_resource_interfaces/srv/load_config.hpp> |
|
|
||
| /// Load display settings from the given file. | ||
| /** | ||
| * \param path The full path of the config file to load from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update docs
Signed-off-by: Crola1702 <[email protected]>
|
Comments addressed @ahcorde. Thank you! |
ahcorde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpplint is failing /tmp/ws/src/rviz/rviz_common/src/rviz_common/visualization_frame.cpp:734: At least two spaces is best between code and comments [whitespace/comments] [2]
clalancette
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two large questions about this feature.
- Do we need this at all? I know the original issue asked for a way to reload configurations without restarting rviz, but I think we have that already. If you click on File->Open and open a config, it will replace the last config. That said, there currently isn't a programmatic way to do it. But before we add more features, I think it would be good to ask the original reporter whether using the GUI would work for them.
- If we do need this, I think that we should split up the implementation of loading the config more. In particular, I think we should have a method
loadDisplayConfigFromYamlwhich takes in aYamlConfigReader. The service can setup a YamlConfigReader from the string, then call this function. We would leave the existing overload ofloadDisplayConfigthat takes a filename, and this would open aYamlConfigReaderwith the file, then callloadDisplayConfigFromYaml. Does that make sense?
I think that we discussed this in person at the hackathon, but I hadn't had a chance to follow-up on a review here yet. |
Description
These changes implement the feature requested in #1594, by creating the service when the visualization frame is initialized.
Changes:
loadDisplayConfigwhich now receives a string that can be a path to a configuration file or the configuration yaml stringloadDisplayConfigrviz_resource_interfaces